#include <stdio.h> 
int main(void)
{
	char c;
	int letter, number, space, punctuation;
	letter=0; number=0; space=0; punctuation=0;
	while(1)
	{
	c=getchar();
	if((c>='A'&&c<='Z')||(c>='a'&&c<='z'))
		letter++;
	else if(c>='0'&&c<='9')
		number++;
	else if(c==' ')
		space++;
	else if((c>=33&&c<=47)||(c>=58&&c<=64)||(c>=91&&c<=96)||(c>=123&&c<=126)) 
		punctuation++;
	else if(c==10||c==13) 
		break;
	else
		continue;
	} 
	printf("%d %d %d %d",letter, number, space, punctuation) ;
	return 0;
}
